package com.pig4cloud.pig.djjk.job;

import com.pig4cloud.pig.djjk.service.wd.WdTrackService;
import com.pig4cloud.pig.djjk.service.wd.WdboxService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @className: SynTraceJob
 * @description: TODO 类描述
 * @author: liumingkun
 * @date: 2025/6/7
 **/

@Component
public class SynTraceJob {

    private final static Logger logger = LoggerFactory.getLogger(SynTraceJob.class);

    @Autowired
    private WdTrackService wdTrackService;

    /**
     * 秒、分、时、日、月、星期
     */
    @Scheduled(cron = "0 * * * * *")
    public void writeJob() {
        logger.info("开始将轨迹写入数据库");
		wdTrackService.addTrackRecord();
    }


	/**
	 * 清理舷梯信息
	 */
	@Scheduled(cron = "0 * * * * *")
	public void cleanStairJob() {
		logger.info("开始清理舷梯信息");
		wdTrackService.clearLadderPosition();
	}
}
